<?php
/**
 * (logic)文件解析
 */
namespace App\Logic\File;

use App\Logic\File\ZiNiao\ParseFile as ZParseFile;
use App\Logic\File\Operation\ParseFile as OParseFile;
use App\Logic\File\Profit\ParseFile as PParseFile;
use App\Logic\File\ProfitLT\ParseFile as PParseFileLT;
class FileParseWork
{
    /**
     * 紫鸟文件解析
     */
    public static function parseZiNiao(){
        $start = time();
        $start_memory = memory_get_usage();
        ZParseFile::parse();
        $end = time();
        $end_memory = memory_get_usage();
        if (app()->runningInConsole()) {
            echo ($end - $start).'--------'.(($end_memory - $start_memory)/1024/1024);
        }
    }

    /**
     * 运营文件解析
     */
    public static function parseOperation(){
        $start = time();
        $start_memory = memory_get_usage();
        OParseFile::parse();
        $end = time();
        $end_memory = memory_get_usage();
        if (app()->runningInConsole()) {
            echo ($end - $start).'--------'.(($end_memory - $start_memory)/1024/1024);
        }
    }

    /**
     * 月报文件解析
     */
    public static function parseProfit(){
        $start = time();
        $start_memory = memory_get_usage();
        PParseFile::parse();
        $end = time();
        $end_memory = memory_get_usage();
        if (app()->runningInConsole()) {
            echo ($end - $start).'--------'.(($end_memory - $start_memory)/1024/1024);
        }
    }

    /**
     * 月报文件解析-乐天
     */
    public static function parseProfitLT(){
        $start = time();
        $start_memory = memory_get_usage();
        PParseFileLT::parse();
        $end = time();
        $end_memory = memory_get_usage();
        if (app()->runningInConsole()) {
            echo ($end - $start).'--------'.(($end_memory - $start_memory)/1024/1024);
        }
    }
}
